home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / rodent.zip / GMOUSE.DOC < prev    next >
Text File  |  1987-09-28  |  29KB  |  1,273 lines

  1.  
  2.  
  3.  
  4.           GMOUSE.DOC - GENIUS MOUSE Programming Interface
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.                Programmer's Reference Manual
  23.  
  24.  
  25.  
  26.                    GENIUS-MOUSE DRIVER
  27.                    Serial Mouse Version
  28.                   Release 7.01
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. KUN YING ENTERPRISE CO.,LTD.
  48. RM. 1311,NO.41,SEC 1,
  49. CHUNG HSIAO W. RD.
  50. TAIPEI, TAIWAN, R.O.C.
  51. P.O. BOX: 22826 TAIPEI
  52. TEL: 3813682 3318779 3118545 3822228
  53. TELEX: 11388 KUNYING
  54. FAX: 2-361-5300
  55.  
  56.  
  57.  
  58.  
  59.                                page 1
  60.  
  61.  
  62.  
  63. Introduction
  64.  
  65.  
  66. The following provides information to programmers who want
  67. to include support for GENIUS-MOUSE in their application
  68. programs. This document includes descriptions of the
  69. graphics and text cursors, and descriptions of the mouse
  70. functions.
  71.  
  72. This protocol is compatible with the protocol of Microsoft
  73. Corp. as it is documented in the installation and operation
  74. manual published by Microsoft Corp. entitled Microsoft (R)
  75. Mouse User's Guide for IBM (R) Personal Computers.
  76.  
  77. These notes apply to the GENIUS Serial Mouse Driver
  78. (mouse.com and mouse.sys) Release 5.01.
  79.  
  80.  
  81.  
  82. Cursor Descriptions - Text and Graphics Cursors
  83.  
  84. The characteristics of the cursor are determined by
  85. Functions 9 and 10. GENIUS MOUSE has both text and graphics
  86. cursors available. The graphics cursor is a shape that
  87. moves over the images on the screen. The shape can include
  88. an arrow, a sight mark, or others. The software text cursor
  89. is a character attribute that moves from character to
  90. character on the screen. The hardware text cursor is a
  91. moving, sometimes flashing block which also moves from
  92. character to character on the screen. The three cursors are
  93. exclusive - only one can be on the screen at one time. You
  94. have the option of choosing which cursor will appear on the
  95. screen and of switching from one cursor to the other.
  96.  
  97.  
  98. Graphics Cursor
  99.  
  100. The graphics cursor is an array of pixels (normally 16 by
  101. 16).  It is defined by two arrays of bits called the screen
  102. mask and the cursor mask.
  103.  
  104. The screen mask is used to determine which of the cursor
  105. pixels becomes are part of the shape (1) or of the
  106. background (0) (it is ANDed with the screen contents).    The
  107. cursor mask is used to determine which of the pixels of the
  108. cursors contribute to the color/shape of the cursor (it is
  109. XORed with the result of the previous operation).
  110.  
  111.  
  112.  
  113.                                page 2
  114.  
  115.  
  116.  
  117. The operational behaviour of these bit arrays are
  118. summarized by the following table:
  119.  
  120. screen mask   cursor mask    resulting screen bit
  121.  0           0          0
  122.  0           1          1
  123.  1           0          unchanged
  124.  1           1          inverted
  125.  
  126.  
  127. Note that when a mouse function refers to the graphics
  128. cursor location it is referring to the point on the screen
  129. that lies directly under the cursor's target area. The
  130. target area is the point in the cursor block that the mouse
  131. software uses to determine the cursor coordinates. This
  132. point is called the hot spot of the cursor. The upper left
  133. corner of the cursor block is the hot spot for the default
  134. graphic cursor.
  135.  
  136.  
  137.  
  138. Text Cursor
  139.  
  140. The text cursor is a cursor that can be used when the video
  141. is in one of the text modes.
  142.  
  143. Two kind of text cursors are supported: a hardware text
  144. cursor and a software text cursor.
  145.  
  146. The hardware text cursor is the cursor actually placed on
  147. the screen by the video controller itself. It is defined in
  148. terms of the scan lines of the character cell numbered from
  149. 0 starting from the top scan line. The numbers of scan
  150. lines on a character cell depends on the actual video
  151. controller and monitor (see the controller documentation
  152. for details).
  153.  
  154. The software text cursor is a character or a character
  155. attribute that replaces and/or modifies the character cell
  156. on the screen where it is positioned.
  157.  
  158. The behaviour of this cursor is defined by 2 16-bit values.
  159.  
  160. The format of the two values is the following:
  161.  
  162. bit     description
  163. 15     blinking (1) or non blinking (0) character
  164. 14-12     background color
  165. 11     high intensity (1) or medium intensity (0)
  166. 10-8     foreground color
  167. 7-0     character code
  168.  
  169.  
  170.                                page 3
  171.  
  172.  
  173.  
  174. The two values are called the screen mask and the cursor
  175. mask.  The screen mask is used to determine which of the
  176. character attributes are preserved (it is ANDed with the
  177. screen character and attribute).  The cursor mask is used
  178. to determine which of the characteristics are changed by
  179. the cursor (it is XORed with the result of the previous
  180. operation).
  181.  
  182.  
  183.  
  184. Notice to System Programmers
  185.  
  186. System programmers who intercept the video i/o software
  187. interrupt (int 10h) should exercise utmost care, and note
  188. the following:
  189.  
  190. The program should guarantee that video mode changes
  191. (function 0) are intercepted by the mouse driver. The mouse
  192. driver guarantees consistency of the screen contents to
  193. programs that write on the screen via int 10h (or via
  194. DOS).
  195.  
  196. Some programs write directly on the video memory.  In this
  197. case the application program should use function 2 (hide
  198. cursor) or 16 (conditional hide cursor) before writing,
  199. then function 1 (show cursor) after writing.  GWBASIC is an
  200. example of such a program.
  201.  
  202.  
  203. The presence of the mouse driver can also be detected by
  204. checking the interrupt vector entry for interrupt 51 in low
  205. memory for value 0 or for pointing to an IRET instruction.
  206. This method should be used with some care as it is
  207. dependent on the release of DOS.
  208.  
  209.  
  210. The programming interface uses the 8086 software interrupt
  211. 51. Parameter values are passed and returned via 8086
  212. registers. This interface can be used from assembly
  213. language programs or from high level language programs such
  214. as BASIC , FORTRAN , COBOL , C or Pascal.
  215.  
  216. You can also let the mouse software call a subroutine in your
  217. program whenever a specific condition occurs. When this
  218. capability is enabled, the mouse software interrupts whatever
  219. process is going on and passes execution control to the
  220. subroutine that you have specified in Function 12 of the mouse
  221. system calls.
  222.  
  223.  
  224.                                page 4
  225.  
  226.  
  227.  
  228. Making Calls From Assembly Language Programs :
  229.  
  230. TO make mouse systemcalls from an assembly language program,
  231. you must:
  232.  
  233.  1. Load the AX, BX, CX and DX registers with the parameter
  234.     values.
  235.  
  236.  2. Execute software interrupt 51(33H)
  237.     The AX, BX, CX and DX registers correspond to the M1%,
  238.     M2%, M3%, and M4% parameters. defined for the BASIC program.
  239.     Values returned by the Mouse functions will be placed in the
  240.     registers.
  241.  
  242. Example
  243.  
  244.  Use the following instructions to set the cursor position to 150
  245.  (horizontal) and 100 (vertical):
  246.  
  247.      ; * set cursor to location (150,100)
  248.      Mov  AX,4       ;(function call 4)
  249.      Mov  CX,150   ;(set Horiziontal to 150)
  250.      Mov  DX,100   ;(set vertical to 100)
  251.      Int  51       ;(interrupt to mouse)
  252.  
  253. Note: When making a mouse system call in Assembly Language,
  254.       function 9 and 12 expect a somewhat different.
  255.       Value for the fourth parameter than when calling from a
  256.       Basic program.
  257.  
  258.  
  259.  
  260.  
  261.                                page 5
  262.  
  263.  
  264.  
  265. Making Calls from BASIC (BASICA) Language Program :
  266.  
  267.  
  268. It is possible to make a mouse system call from a BASIC
  269. program running under the GWBASIC interpreter.    The
  270. following shows how to make these calls.
  271.  
  272. Insert an initialization sequence such as:
  273.  
  274.     10    DEF SEG=0
  275.     20    MSEG=256*PEEK(51*4+3)+PEEK(51*4+2)
  276.     30    MOUSE=256*PEEK(51*4+1)+PEEK(51*4)+2
  277.     40    DEF SEG=MSEG
  278.  
  279. Be sure that the statements appear before any calls to
  280. mouse functions.  Then use the CALL statement to make the
  281. call.
  282.  
  283.     CALL MOUSE(M1%,M2%,M3%,M4%)
  284.  
  285. where MOUSE is the variable containing the entry offset of
  286. the mouse software, and M1%, M2%, M3%, and M4% are the
  287. names of the integer variables you have chosen for
  288. parameters in this call.  They correspond to the values for
  289. AX, BX, CX, and DX which are described in this document.
  290. As an example:
  291.  
  292.     100  'Set minimum and maximum horizontal position to
  293.      '(320,100)
  294.     200  M1%=7 'function number is 7
  295.     300  M3%=0 'minimum coordinate
  296.     400  M4%=639 'maximum coordinate
  297.     500  CALL MOUSE(M1%,M2%,M3%,M4%)
  298.  
  299.  
  300.  
  301.  
  302.                                page 6
  303.  
  304.  
  305. List of Mouse Functions
  306.  
  307. The f